<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Edit user</title>
</head>
<body>

	<c:if test="${ empty viewUserDto }">
		greška
	</c:if>

	<c:if test="${ not empty viewUserDto }">
		<form:form action="edit" commandName="viewUserDto" method="POST">
			<table>
				<tr>
					<td><label for="username">Username</label></td>
					<td>${ user.username }</td>
				</tr>
				<tr>
					<td><form:label path="firstname">Firstname</form:label></td>
					<td><form:input path="firstname" /></td>
					<td><form:errors path="firstname" ></form:errors></td>
				</tr>
				<tr>
					<td><form:label path="lastname">Lastname</form:label></td>
					<td><form:input path="lastname" /></td>
					<td><form:errors path="lastname" ></form:errors></td>
				</tr>
				<tr>
					<td><form:label path="dateOfBirth">Date of birth</form:label></td>
					<td><form:input path="dateOfBirth" /></td>
					<td><form:errors path="dateOfBirth" ></form:errors></td>
				</tr>
				<tr>
					<td><form:label path="email">Email</form:label></td>
					<td><form:input path="email" /></td>
					<td><form:errors path="email" ></form:errors></td>
				</tr>
				<tr>
					<td><input type="reset" value="Reset"></td>
					<td><input type="submit" value="Edit"></td>
				</tr>
			</table>
		</form:form>
		<a href="${pageContext.request.contextPath}/changePassword">Change password</a>
		<br>
		<a href="${pageContext.request.contextPath}/delete">Delete profile</a>
	</c:if>

</body>
</html>